export function useResize(el:HTMLElement, callback: Function) {
    const observer = new ResizeObserver((entrys) => {
        entrys.forEach((entry) => {
            // console.log('entry', entry.contentRect);
            callback?.(entry.contentRect)
        })
    })
    observer.observe(el)
}
import {App, DirectiveBinding} from 'vue'
export const vResize = {
    install (app: App) {
        app.directive('resize', (el:HTMLElement, binding:DirectiveBinding) => {
            useResize(el, binding.value)
        })
    }
}